package com.alamiya.security.service.impl;

import com.alamiya.security.entity.PublicRole;
import com.alamiya.security.mapper.PublicRoleMapper;
import com.alamiya.security.service.IPublicRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hehaoqi
 * @since 2021-02-02
 */
@Service
public class PublicRoleServiceImpl extends ServiceImpl<PublicRoleMapper, PublicRole> implements IPublicRoleService {

    @Override
    public String getRoleName(String roleId) {
        PublicRole role = getById(roleId);
        if (Objects.isNull(role)) {
            return Strings.EMPTY;
        }
        return role.getRoleName();
    }


}
